// 云函数入口文件
const cloud = require('wx-server-sdk')
const env ='xiaochengxu123-4g1bmjp6bb5e9189'
cloud.init()
const db=cloud.database({env})
// 云函数入口函数
exports.main = async (event, context) => {
  const userInfo = event.userInfo
  return await db.collection('keeper').add({
    data:{
      createBy:userInfo.openId,
      createday:new Date().getDate(),
      Runcount:event.Runcount,
      keepcount:event.keepcount,
      deepcount:event.deepcount,
      plancount:event.plancount,
      isRun:event.isRun,
      isdeep:event.isdeep,
      iskeep:event.iskeep,
      isplan:event.isplan
    } 
  })
}